GtkAppChooserButton: Fix a possible crash
authorMatthias Clasen <mclasen@redhat.com>
Sat, 7 Jun 2014 18:03:45 +0000 (14:03 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 9 Jun 2014 17:30:53 +0000 (13:30 -0400)
We were not correctly dealing with content_type being NULL
in one place.

gtk/gtkappchooserbutton.c

index 9bdcf8b79abd9b401d387e683b04e17b1ed9311d..af910c8d013819fb7c6e69e16849f91b92981706 100644 (file)
@@ -332,7 +332,8 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
 
   if (self->priv->show_default_item)
     {
-      default_app = g_app_info_get_default_for_type (self->priv->content_type, FALSE);
+      if (self->priv->content_type)
+        default_app = g_app_info_get_default_for_type (self->priv->content_type, FALSE);
 
       if (default_app != NULL)
         {